<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>




<script type="text/javascript">
$.unblockUI();
function viewProject(id){
	$.post('./project/viewProject.action',{'id':id}, function(respuestaHTML) {
				$('#content').html(respuestaHTML);
		});
	}
	
function deleteProject(id){
	$.post('./project/deleteProject.action',{'id':id}, function(respuestaHTML) {
				$('#content').html(respuestaHTML);
		});
	}
	
function modifyProject(id){
	$.post('./project/modifyProject.action', {'id':id}, function(respuestaHTML) {
				$('#content').html(respuestaHTML);
			});
	}
</script>

<div class="page-header">
  <h1>Project List</h1>
</div>

<div id="Projects"></div>
	<table class="table table-striped">
		<thead>
		<tr>
			<th>ID</th>
			<th>PROJECT NAME</th>
			<th>TOTAL HOURS</th>
			<th>START DATE</th>
			<th>END DATE</th>
			<th>OPTIONS</th>
		<tr/>
		</thead>
		<s:iterator value="projects">
			<tr>
				<td><s:property value="id" /></td>
				<td><s:property value="name" /></td>
				<td><s:property value="hours" /></td>
				<td><s:property value="period.startDate" /></td> 
				<td><s:property value="period.endDate" />
				<td>
					<a href="#" onclick="viewProject(<s:property value="id" />)" class="btn btn-mini"><i class="icon-search"></i>view</a>
					<a href="#" onclick="modifyProject(<s:property value="id" />)" class="btn btn-mini  btn-info"><i class="icon-pencil"></i>edit</a>
					<a href="#" onclick="deleteProject(<s:property value="id" />)" class="btn  btn-danger btn-mini"><i class="icon-trash"></i>delete</a>
				</td>
			</tr>
		</s:iterator>
	</table>